<!DOCTYPE html>
<!-- saved from url=(0107)http://www.mogujie.com/trade/address?ptp=1.pAo2d9pI.0.47.QU715&_uk=7de56b1f4c17a101b94bd23049393339b7274d31 -->
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>蘑菇街 - 我的买手街！</title>
		<meta name="keywords" content="蘑菇街,mogujie,买手,买手街,网购">
		<meta name="description" content="蘑菇街-中国最大的女性电子商务平台，精选款式美、质量优、价格合理的衣服、鞋子、箱包、配饰和美妆等潮流商品。让8000万女性会员在这里享受购物乐趣，发现时尚精品，分享消费体验。">
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
		<meta name="copyright" content="mogujie.com">
		<script type="text/javascript" src="{{URL::asset('js/area.js')}}"></script> 
		
		<meta name="robots" content="nofollow">
		<link rel="search" type="application/opensearchdescription+xml" href="http://www.mogujie.com/opensearch.xml">
		<link rel="icon" href="http://s16.mogucdn.com/new1/v1/bmisc/3ce382db3c8aaca5d07bd36711e77134/171169993508.ico" type="image/x-icon">   
		<link rel="stylesheet" type="text/css" href="{{URL::asset('./css/pkg-navigation.css$ccc0b1cb_1466416513.css')}}" media="all">
		<link rel="stylesheet" type="text/css" href="{{URL::asset('./css/module-captcha.css$ccc0b1cb_1466416513.css')}}" media="all">
		<link rel="stylesheet" type="text/css" href="{{URL::asset('./css/page-muorder-common.css$ccc0b1cb_1466416513.css')}}" media="all">
		<script src="{{URL::asset('js/jquery-1.7.2.js')}}"></script>
	</head>
	<body class="media_screen_1200">
		@include('common.header1')
		<!-- 中间区域 -->
		<div id="body_wrap">
			<div id="body" class="fm960">
				<div class="mu_wrap clearfix">
					@include('common.header')
					<div class="mu_content_wrap">
						<div class="addr_right topay" isaddress="true" topaycount="">
							<h2 class="addr_title">地址管理</h2>
							<div class="addr_edit" id="J_s_addr_edit">
								<div class="add_new_addr clearfix"><span id="J_saddAddress">+添加地址</span></div>
								<div class="addressbox_warp" id="warp" style="display:none">
									<div class="addressbox" id="J_sAddrWrap" style="display: block;">
										<form action="/addressGl/add" method="post" name="myform">
										{!!csrf_field()!!}
											<div class="__addressPop">
												<dl class="address_pop">
													<input type="hidden" class="J_addressid" name="id" value="1">
													<dt>省：<i class="needicon">*</i><span></dt>
													<dd>
														<div class="info" >
															<div>
																<select id="s_province" name="province"></select>&nbsp;&nbsp;
																<select id="s_city" name="city"  ></select>&nbsp;&nbsp;
																<select id="s_county" name="county"></select>
																<script class="resources library" src="{{URL::asset('js/area.js')}}" type="text/javascript"></script>
																<script type="text/javascript">_init_area();</script>
															</div>
															<div id="show"></div>
														</div>
													</dd>
													<dd class="pt_ie6hack">
														<span class="prompt"></span>
													</dd>
													<dt style="margin-top:-25px">邮政编码：</dt>
													<dd style="margin-top:-25px">
														<i class="needicon">*</i>
														<input type="text"  value="" id="postalcode" class="text formsize_normal J_postcode J_form vm" name="postalcode">
														<span class="prompt"></span>
													</dd>
													<dt>街道地址：</dt>
													<dd>
														<i class="needicon">*</i>
														<textarea  class="textarea formsize_large J_street J_form" name="address" cols="30" rows="3"></textarea>
														<span class="prompt breakline">请填写街道地址，最少5个字，最多不能超过100个字</span>
													</dd>
													<dt>收货人姓名：</dt>
													<dd>
													<i class="needicon">*</i><input type="text" id="name" class="text formsize_normal J_name J_form vm" name="name">
													<span class="prompt"></span>
													</dd>
													<dt>手机：</dt>
													<dd>
														<i class="needicon">*</i><input type="text"  class="text formsize_normal J_mobile J_form vm" name="phone">
														<span class="prompt"></span>
													</dd>
													<dt></dt>
													<dd class="pt10 oper_btn">
														<a href="javascript:;" onclick="document.myform.submit()" class="confirm_btn J_okbtn mr10">确认地址</a>
														<a href="javascript:;" id="cancel" class="cancel_btn J_cancelbtn">取消</a>
													</dd>
												</dl>
											</div>
										</form>
									</div>
								</div> 
								<script>
									var J_saddAddress=document.getElementById('J_saddAddress');
									var	warp=document.getElementById('warp');
									var	cancel=document.getElementById('cancel');
									
									J_saddAddress.onclick=function(){
										warp.style.display='block';
									}
									cancel.onclick=function(){
										warp.style.display='none';
									}
									
								</script>
								@foreach($result1 as $results)
								<div class="addr_section " aid="2112209666">
									<ul class="clearfix">
										<li class="name" style="width:50px">{{$results->name}}</li>&nbsp;&nbsp;
										<li class="addr" style="margin-left:40px">
										{{$results->province}}{{$results->city}}{{$results->county}}
										</li>&nbsp;&nbsp;
										<li class="" style="margin-left:-40px">{{$results->postalcode}}</li>
										<li class="mobile" style="margin-left:20px">{{$results->phone}}</li>
										<li class="oper">
									<!--	@if($results-> status ==1)
											<a href="/setAddress/{{$results->id}}/{{$results->status}}" class="J_default">默认地址</a>
										@elseif($results->status==0)
											<a href="/setAddress/{{$results->id}}/{{$results->status}}" class="J_default">设为默认</a>
										@endif
									-->
											<a href="javascript:void(0)" id="{{$results->id}}" class="edit">编辑</a>
											<a href="/deleteAddress/{{$results->id}}"  class="del nobd">删除</a>
										</li>
										<li class="enaddr"></li>
									</ul>
									<script>
									//编辑回填
									var edit=document.getElementsByClassName('edit');
									var spans=[];
									var	warp=document.getElementById('warp');
									for(var i=0;i<edit.length;i++){
										edit[i].onclick=function(){
											warp.style.display='block';
											//ajax实现回填
											$(function(){
												//选中元素
												$('.edit').click(function(){
													//获取当前操作的商品id
													var id=$(this).attr('id');
													//ajax操作
													$.ajax({
														//url
														url:'/updateAddress/'+id,
														type:'get',
														dataType:'json',
														success:function(data){
															//根据返回数据操作
															console.log(data);
															$('#postalcode').val(data.postalcode);
															$('.textarea').val(data.address);
															$('#name').val(data.name);
															$('.J_mobile').val(data.phone);
															//$('#s_province').val(data.province);
															//$('#s_city').val(data.city);
															//console.log(data.city);
															//$('#s_county').val(data.county);	
														}
													});
												});
											});
										}
									}
								</script>
								</div>
								@endforeach
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		@include('common.footer')
	</body>
</html>